package com.thoughtworks.preuniversity.biblioteca;

/**
 * Created by padmavb on 6/20/14.
 */
public class User {

    private  String name,emailId,password;
    private int phoneNumber;
    public User(String name, String emailId, int phoneNumber, String password) {

        this.name=name;
        this.emailId=emailId;
        this.phoneNumber=phoneNumber;
        this.password=password;
    }

    public String getPassword() {
        return password;
    }

    public String getName() {
        return name;
    }

    public String getEmailId() {
        return emailId;
    }

    public int getPhoneNumber() {
        return phoneNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (phoneNumber != user.phoneNumber) return false;
        if (!emailId.equals(user.emailId)) return false;
        if (!name.equals(user.name)) return false;
        if (!password.equals(user.password)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name.hashCode();
        result = 31 * result + emailId.hashCode();
        result = 31 * result + password.hashCode();
        result = 31 * result + phoneNumber;
        return result;
    }
}
